package com.jn.news.viewmodel;

import androidx.lifecycle.ViewModel;

import com.jn.news.model.JuheNews;
import com.jn.news.model.News;
import com.jn.news.model.RespDto;
import com.jn.news.net.HttpRequestUtils;

import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.disposables.CompositeDisposable;

public class JuheNewsListViewModel extends ViewModel {
    private final HttpRequestUtils httpRequestUtils;
    private CompositeDisposable disposable = new CompositeDisposable();
    public JuheNewsListViewModel(){
        httpRequestUtils = new HttpRequestUtils();
    }
    public Observable<RespDto<JuheNews>> getJuheNewsList(String type, int pageSize, int pageNum) {
        return httpRequestUtils.getJuheNews(type,pageSize,pageNum);
    }

    public void dispose() {
        disposable.clear();
    }
}
